package game.sb;

import com.bit.catmoney.MainActivity;
import com.bit.catmoney.R;

import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;

public class PrefActivity extends Activity implements OnClickListener {

	public static final String KEY_MY_PREFERENCE = "my_preference";

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_pref);

		// ù��° ���ڴ� Ű, �ι�° ���ڴ� Ű�� ���� �����Ͱ� �������� ���� ����� ����Ʈ��
		((EditText) findViewById(R.id.txtid)).setText("");

		((Button) findViewById(R.id.Okbtn)).setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		EditText editText = (EditText) findViewById(R.id.txtid);
		String txtid = editText.getText().toString();

		// ����Ÿ�������մϴ�.
		SharedPreferences prefs = getSharedPreferences("PrefName", MODE_PRIVATE);
		SharedPreferences.Editor editor = prefs.edit();
		editor.putString(KEY_MY_PREFERENCE, txtid);
		editor.commit();
		
		Intent intent = new Intent(PrefActivity.this, MainActivity.class);
		intent.putExtra("idtxt", txtid);
		startActivity(intent);
	}

}







